﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ListenMusic.User_Song_ServiceReference;
using System.ServiceModel;
namespace ListenMusic.Models.Reposistory.User
{
    public class SongReposistory
    {
        SongServiceClient songClient;
        public SongReposistory()
        {
           
        }
        public bool updateLyrics(int songid, string lyrics)
        {
            songClient = new SongServiceClient();
            songClient.ClientCredentials.UserName.UserName = "ClientUser";
            songClient.ClientCredentials.UserName.Password = "123456";
            try {
                return songClient.UpdateLyrics(songid, lyrics);
            }
            catch (FaultException e) { return false; throw e; }
        }
        public int getMaxID_SongID()
        {
            songClient = new SongServiceClient();
            songClient.ClientCredentials.UserName.UserName = "ClientUser";
            songClient.ClientCredentials.UserName.Password = "123456";
            try
            {
                return songClient.getMax_SongID();
            }
            catch (FaultException e) { throw e; }
        }
    }
    
}